package com.briup.ch11;

import java.io.File;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/15
 * @Description:
 */
public class Test5 {
    public static File deleteAll(File dir) {
        if (dir.isDirectory()) {
            for (File file : dir.listFiles()) {
                deleteAll(file);
            }
        }
        dir.delete();
        System.out.println("delete file: "+dir.getName());
        return null;
    }
    public static void main(String[] args) {
        File dir = new File("testDir");
        deleteAll(dir);
    }
}
